﻿using System;
using System.Collections.Generic;
using UnityEngine.UIElements;
using winS.Unity.Process;

namespace winS.UnityEditor.ProcessEditor
{
    /// <summary>
    /// 只输出节点.
    /// 该节点自带一个输出端口
    /// </summary>
    public abstract class OutputOnlyStepNode<T> : PortStepNode<T>, IOutputable where T : class, IGeneralStep
    {
        public OutputPort outputPort { get; protected set; }

        internal override void Initialize()
        {
            base.Initialize();
            portContainer.style.flexDirection = FlexDirection.RowReverse;
            portContainer.Add(outputPort = new OutputPort(this, step.nextStepsList));
            outputPort.style.marginBottom = outputPort.style.marginTop = 8f;
        }

        IEnumerable<OutputPort> IOutputable.GetOutputPorts()
        {
            yield return outputPort;
        }
    }
}